plugin('ajax', function () {
    var Ajax = function () {
        this.version = 'v1.0';
    };

    Ajax.prototype = {
        constructor: Ajax,
        //  ajax 请求
        get: function (url, cb) {
            $.ajax({
                type: 'GET',
                url: url,
                success: cb,
                error: function (html) {
                    alert("网络错误，请稍后再试");
                }
            });
        },
        getJSON: function (url, cb) {
            $.ajax({
                type: 'GET',
                url: url,
                dataType: 'json',
                success: cb,
                error: function (html) {
                    alert("网络错误，请稍后再试");
                }
            });
        },
        post: function (url, params, cb, traditional) {
            $.ajax({
                type: 'POST',
                url: url,
                data: params,
                success: cb,
                traditional: traditional ? traditional : false,
                error: function (html) {
                    alert("网络错误，请稍后再试");
                }
            });
        },
        json: function (url, params, cb) {
            $.ajax({
                type: 'POST',
                url: url,
                data: params,
                dataType: 'json',
                success: cb,
                error: function (html) {
                    alert("网络错误，请稍后再试");
                }
            });
        },
        upload: function (url, formdata, cb) {
            $.ajax({
                url: url,
                type: 'POST',
                cache: false,
                data: formdata,
                processData: false,
                contentType: false,
                success: cb,
                error: function (html) {
                    alert("网络错误，请稍后再试");
                }
            });
        }

    };
    return Ajax;
});